package xfsale.web;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.PropertyConfigurator;

public class Log4jServlet extends HttpServlet {

    @Override
	public void init() {
		String prefix = getServletContext().getRealPath("/");
		String file = getInitParameter("log4j-config");
		if (file != null) {
			PropertyConfigurator.configure(prefix + file);
		}
		System.out.println("log4j初始化成功!");
	}

    @Override
	public void doGet(HttpServletRequest req, HttpServletResponse res) {
	}

}
